<!DOCTYPE html>
<html>
<head>
    <title></title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <#if shiro.hasPermission("sys:sysjdbc:info")>
            <a class="btn btn-primary" @click="view"><i class="fa fa-eye"></i>&nbsp;查看</a>
            </#if>
			<#if shiro.hasPermission("sys:sysjdbc:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("sys:sysjdbc:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("sys:sysjdbc:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
			<#if shiro.hasPermission("sys:sysjdbc:overload")>
            <a class="btn btn-primary" @click="overload"><i class="fa fa-repeat"></i>&nbsp;重载数据源</a>
			</#if>
			<#if shiro.hasPermission("sys:sysjdbc:locking")>
            <a class="btn btn-primary" @click="locking"><i class="fa fa-lock"></i>&nbsp;锁定数据源</a>
			</#if>
			<#if shiro.hasPermission("sys:sysjdbc:clean")>
            <a class="btn btn-primary" @click="clean"><i class="fa fa-eraser"></i>&nbsp;清空数据源</a>
			</#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">数据库名称</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-bind:readonly="isReadOnly"
                           v-model="sysJdbc.jdbcName" placeholder="数据库名称"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">数据库驱动</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-bind:readonly="isReadOnly"
                           v-model="sysJdbc.jdbcDriver" placeholder="数据库驱动"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">数据库地址</div>
                <div class="col-sm-10">
                    <textarea rows="5" class="form-control" v-bind:readonly="isReadOnly"
                              v-model="sysJdbc.jdbcUrl" placeholder="数据库地址"></textarea>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">用户名</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-bind:readonly="isReadOnly"
                           v-model="sysJdbc.jdbcUsername" placeholder="用户名"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">登录密码</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-bind:readonly="isReadOnly"
                           v-model="sysJdbc.jdbcPwd" placeholder="登录密码"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">创建时间</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-bind:readonly="isReadOnly"
                           v-model="sysJdbc.createTime" placeholder="创建时间"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">更新时间</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-bind:readonly="isReadOnly"
                           v-model="sysJdbc.updateTime" placeholder="更新时间"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" v-bind:class="{hidden:isReadOnly}"
                       id="btnSaveOrUpdate" data-loading-text="保存中..." @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/sys/sysjdbc.js?_${.now?long}"></script>
</body>
</html>